#include "SMPPSourceNodeId.hpp"

using namespace smpp::pdu;

SourceNodeId::SourceNodeId(const octetString &nValue):
TLV(TLVtags::TAG_SOURCE_NODE_ID,nValue.size()),_Value(nValue){}

SourceNodeId::SourceNodeId(const SourceNodeId &nSourceNodeId):
TLV(nSourceNodeId),_Value(nSourceNodeId.getValue()){}

bool SourceNodeId::operator ==(
	const SourceNodeId &nSourceNodeId) const{
	return (TLV::operator == (nSourceNodeId) && 
	_Value == nSourceNodeId.getValue());
}

bool SourceNodeId::operator !=(
	const SourceNodeId &nSourceNodeId) const{
	return !this->operator == (nSourceNodeId);
}

SourceNodeId &SourceNodeId::operator = (
	const SourceNodeId &nSourceNodeId){
	if(*this == nSourceNodeId)
		return *this;
	TLV::operator = (nSourceNodeId);
	_Value = nSourceNodeId.getValue();
	return *this;
}

void SourceNodeId::setValue(const octetString &nValue){
	_Value = nValue;
}

const octetString &SourceNodeId::getValue() const{
	return _Value;
}
